package statePattern;

//上下文类--维护当前状态的引用
public class Context {

    private State currentState;


    public void setCurrentState(State currentState) {
        this.currentState = currentState;
    }

    public void request(){
        if (currentState!= null){
            currentState.handle();
        }
    }
}
